﻿/*
 Navicat Premium Data Transfer

 Source Server         : 127.0.0.1
 Source Server Type    : MySQL
 Source Server Version : 80031
 Source Host           : 127.0.0.1:3306
 Source Schema         : db_dorm

 Target Server Type    : MySQL
 Target Server Version : 80031
 File Encoding         : 65001

 Date: 16/11/2023 17:02:48
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_build
-- ----------------------------
DROP TABLE IF EXISTS `t_build`;
CREATE TABLE `t_build` (
                           `id` int NOT NULL AUTO_INCREMENT,
                           `name` varchar(20)  DEFAULT NULL COMMENT '楼栋名',
                           `num` varchar(20) DEFAULT NULL COMMENT '楼栋号',
                           `detail` varchar(128)  DEFAULT NULL,
                           PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=20 COMMENT='楼栋表';

-- ----------------------------
-- Records of t_build
-- ----------------------------
BEGIN;
INSERT INTO `t_build` VALUES (1, '明德楼', '1', NULL);
INSERT INTO `t_build` VALUES (2, '雅致楼', '2', NULL);
INSERT INTO `t_build` VALUES (3, '丹桂园', '3', NULL);
INSERT INTO `t_build` VALUES (4, '修身楼', '4', NULL);
INSERT INTO `t_build` VALUES (5, '淡泊楼', '5', NULL);
INSERT INTO `t_build` VALUES (19, '文慧楼', '567', '哈哈哈哈哈哈哈哈');
COMMIT;

-- ----------------------------
-- Table structure for t_exchange
-- ----------------------------
DROP TABLE IF EXISTS `t_exchange`;
CREATE TABLE `t_exchange` (
                              `id` int NOT NULL AUTO_INCREMENT COMMENT 'Id',
                              `userId` int DEFAULT NULL COMMENT '学生ID',
                              `userName` varchar(50)  DEFAULT NULL COMMENT '学生姓名',
                              `sex` varchar(10) DEFAULT NULL COMMENT '学生性别：女生;男生',
                              `buildId` int DEFAULT NULL COMMENT '楼栋ID',
                              `buildName` varchar(50)  DEFAULT NULL COMMENT '楼栋号',
                              `roomId` int DEFAULT NULL COMMENT '宿舍ID',
                              `roomNum` varchar(50)  DEFAULT NULL COMMENT '宿舍号',
                              `reason` varchar(140)  DEFAULT NULL COMMENT '调换原因',
                              `date` varchar(64)  DEFAULT NULL COMMENT '调换日期',
                              `status` varchar(20) DEFAULT NULL COMMENT '调换状态：审核中，通过，未通过',
                              PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4  COMMENT='调换申请表';

-- ----------------------------
-- Records of t_exchange
-- ----------------------------
BEGIN;
INSERT INTO `t_exchange` VALUES (1, 2, '王文慧', '女', 2, '开心楼', 2, '201', '想换一个宿舍', '2023-11-11', '已驳回');
INSERT INTO `t_exchange` VALUES (2, 2, 'user', '女', 2, '开心楼', 2, '201', '测试', '2023-11-18', '已驳回');
INSERT INTO `t_exchange` VALUES (3, 2, 'user', '女', 1, '明德楼', 1, '101', '测试', '2023-11-17', '审核中');
COMMIT;

-- ----------------------------
-- Table structure for t_repair
-- ----------------------------
DROP TABLE IF EXISTS `t_repair`;
CREATE TABLE `t_repair` (
                            `id` int NOT NULL AUTO_INCREMENT,
                            `item` varchar(50)  DEFAULT NULL COMMENT '维修项目',
                            `description` varchar(50)  DEFAULT NULL COMMENT '描述',
                            `date` varchar(64)  DEFAULT NULL COMMENT '维修日期',
                            `userId` int DEFAULT NULL COMMENT '学生ID',
                            `userName` varchar(50)  DEFAULT NULL COMMENT '学生名',
                            `buildId` int DEFAULT NULL COMMENT '楼栋ID',
                            `buildName` varchar(50)  DEFAULT NULL COMMENT '楼栋号',
                            `roomId` int DEFAULT NULL COMMENT '宿舍ID',
                            `roomNum` varchar(50)  DEFAULT NULL COMMENT '宿舍号',
                            `status` varchar(20) DEFAULT NULL COMMENT '维修状态：等待维修=0；维修完成=1',
                            `repairor` varchar(50)  DEFAULT NULL COMMENT '维修人',
                            PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5  COMMENT='维修申请表';

-- ----------------------------
-- Records of t_repair
-- ----------------------------
BEGIN;
INSERT INTO `t_repair` VALUES (2, '窗户', '窗户漏风', '2023-11-12', 2, '王文慧', 2, '雅致楼', 2, '201', '维修驳回', '吴师傅');
INSERT INTO `t_repair` VALUES (3, '床', '床断了脚', '2023-11-12', 2, '王文慧', 2, '雅致楼', 2, '201', '维修完成', '吴师傅');
INSERT INTO `t_repair` VALUES (4, '床头灯', '窗户漏风', '2023-11-17', 2, '王文慧', 2, '雅致楼', 2, '201', '等待维修', '吴师傅');
COMMIT;

-- ----------------------------
-- Table structure for t_room
-- ----------------------------
DROP TABLE IF EXISTS `t_room`;
CREATE TABLE `t_room` (
                          `id` int NOT NULL AUTO_INCREMENT,
                          `buildId` int DEFAULT NULL COMMENT '楼栋ID',
                          `buildName` varchar(50)  DEFAULT NULL COMMENT '楼栋名',
                          `num` varchar(20)  DEFAULT NULL COMMENT '宿舍号',
                          `capacity` varchar(20) DEFAULT NULL COMMENT '房间容量：一人间；二人间；四人间；六人间',
                          `status` varchar(20) DEFAULT NULL COMMENT '房间状态：未满；已满',
                          PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10  COMMENT='宿舍表';

-- ----------------------------
-- Records of t_room
-- ----------------------------
BEGIN;
INSERT INTO `t_room` VALUES (1, 1, '明德楼', '101', '二人间', '已满');
INSERT INTO `t_room` VALUES (2, 2, '雅致楼', '201', '2人间', '未满');
INSERT INTO `t_room` VALUES (3, 2, '雅致楼', NULL, '四人间', '未满');
INSERT INTO `t_room` VALUES (4, 2, '雅致楼', NULL, '二人间', '未满');
INSERT INTO `t_room` VALUES (5, 2, '雅致楼', NULL, '二人间', '未满');
INSERT INTO `t_room` VALUES (6, 2, '雅致楼', '333', '四人间', '未满');
INSERT INTO `t_room` VALUES (7, 2, '雅致楼', '333', '四人间', '未满');
INSERT INTO `t_room` VALUES (8, 2, '雅致楼', '1113', '四人间', '未满');
INSERT INTO `t_room` VALUES (9, 2, '雅致楼', '634', '四人间', '未满');
COMMIT;

-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
                          `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
                          `userName` varchar(50)  DEFAULT NULL COMMENT '登录名',
                          `password` varchar(50)  DEFAULT NULL COMMENT '登录密码',
                          `name` varchar(50)  DEFAULT NULL COMMENT '用户名',
                          `num` varchar(50) DEFAULT NULL COMMENT '学号',
                          `buildId` int DEFAULT NULL COMMENT '楼栋ID',
                          `buildName` varchar(50)  DEFAULT NULL COMMENT '楼栋号',
                          `roomId` int DEFAULT NULL COMMENT '宿舍ID',
                          `roomNum` varchar(50)  DEFAULT NULL COMMENT '宿舍号',
                          `sex` varchar(20) DEFAULT NULL COMMENT '用户性别',
                          `tel` varchar(50)  DEFAULT NULL COMMENT '电话',
                          `userType` int DEFAULT NULL COMMENT '角色类型：管理员=1；学生=2',
                          PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6  COMMENT='用户信息表';

-- ----------------------------
-- Records of t_user
-- ----------------------------
BEGIN;
INSERT INTO `t_user` VALUES (1, 'admin', '123', '管理员', '2001', 1, '明德楼', 1, '101', '男', '12222222222', 1);
INSERT INTO `t_user` VALUES (2, 'user', '123', '王文慧', '2002', 2, '雅致楼', 2, '201', '女', '13333333333', 2);
INSERT INTO `t_user` VALUES (4, '王二慧', '123', '王二慧', '1112', 2, '雅致楼', 2, '201', '女', '13312434234', 2);
INSERT INTO `t_user` VALUES (5, '王四慧', '123', '王四慧', '234', 2, '雅致楼', 2, '201', '女', '1234343432', 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
